//
//  NSMutableString+Request.m
//  SuiWan
//
//  Created by xmrk3 on 2017/5/24.
//  Copyright © 2017年 xmrk3. All rights reserved.
//

#import "NSMutableString+Request.h"
#import "NSObject+DefaultValue.h"
#import "NSObject+Reflection.h"

@implementation NSMutableString (Request)

- (void)CT_appendURLRequest:(NSURLRequest *)request
{
    [self appendFormat:@"\n\nHTTP URL:\n\t%@", request.URL];
    [self appendFormat:@"\n\nHTTP Header:\n%@", request.allHTTPHeaderFields ? request.allHTTPHeaderFields : @"\t\t\t\t\tN/A"];
    [self appendFormat:@"\n\nHTTP Body:\n\t%@", [[[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding] CT_defaultValue:@"\t\t\t\tN/A"]];
}


@end
